| Set path
Set Oregano2$Dir <Obey$Dir>

| Load sprites
IconSprites <Oregano2$Dir>.!Sprites

| Acorn URI protocol
Set Alias$Open_URI_http  <Oregano2$Dir>.!Run --nowindow
Set Alias$Open_URI_https <Oregano2$Dir>.!Run --nowindow
Set Alias$Open_URI_file  <Oregano2$Dir>.!Run --nowindow

| ANT URI protocol
Set Alias$URLOpen_http  <Oregano2$Dir>.!Run %%*0
Set Alias$URLOpen_https <Oregano2$Dir>.!Run %%*0
Set Alias$URLOpen_file  <Oregano2$Dir>.!Run %%*0

| Claim HTML and URI files
Set Alias$@RunType_FAF <Oregano2$Dir>.!Run -file %%*0
Set Alias$@RunType_F91 <Oregano2$Dir>.!Run -file %%*0
Set Alias$@RunType_B28 <Oregano2$Dir>.!Run -file %%*0

| Set a font path if we don't have one
If "" = "<TrueTypeFont$Path>" Then Set TrueTypeFont$Path <Oregano2$Dir>.Resources.Fonts.

| Set up the path on which the Application and Resources reside
Set Oregano2$Path <Oregano2$Dir>.,<Oregano2$Dir>.Resources.,<Oregano2Dir>.Fonts.

| Find the Configuration files
Set Oregano2$Messages    Oregano2:Resources.Locale
Set Oregano2$TxCodings   Oregano2:Resources.TxCodings
Set Oregano2$KeyMaps     Oregano2:Resources.KeyMaps
Set Oregano2$Resources   <Oregano2$dir>.Resources
Set Oregano2$Fonts       <TrueTypeFont$Path>

Set Oregano2$Options     <Oregano2$Dir>.Settings.Config
Set Oregano2$Favourites  <Oregano2$Dir>.Settings.Favourites
Set Oregano2$Cookies     <Oregano2$Dir>.Settings.Cookies
Set Oregano2$HTTPAuth    <Oregano2$Dir>.Settings.HTTPAuth

| Check we are running on the correct version of RISC OS
RMEnsure UtilityModule   3.10 Error This application requires RISC OS 3.10 or later

| Ensure CallASWI is installed
RMEnsure UtilityModule   3.70 RMEnsure CallASWI 0.02 RMLoad System:Modules.CallASWI
RMEnsure UtilityModule   3.70 RMEnsure CallASWI 0.02 Error This application requires CallASWI 0.02 or later

| Ensure the floating point emulator is installed
RMEnsure FPEmulator      4.03 RMLoad System:Modules.FPEmulator
RMEnsure FPEmulator      4.03 Error This application requires FPEmulator 4.03 or later

| Ensure the 32bit CLib is installed
RMEnsure SharedCLibrary  5.34 RMLoad System:Modules.CLib
RMEnsure SharedCLibrary  5.34 Error This application requires SharedCLibrary 5.34 or later

| Check for memory allocator module
RMEnsure MemoryAllocator 1.19 RMLoad Oregano2:Modules.Malloc
RMEnsure MemoryAllocator 1.19 Error !Oregano2 requires MemoryAllocator 1.19 or later

| Ensure we have audio support
RMEnsure SharedSound     0.53 RMLoad System:Modules.SSound
RMEnsure SharedSound     0.53 Error This application requires SharedSound 0.53 or later

| Check for Interactor Utils module
RMEnsure InteractorUtils 0.10 RMLoad Oregano2:Modules.OreganUtil
RMEnsure InteractorUtils 0.10 Error This application requires InteractorUtils 0.09 or later

| Check for mime map module
If "<InetDBase$Path>" = "" Then Error Inet databases can not be found
If "<Inet$MimeMappings>" = "" Then Set Inet$MimeMappings InetDBase:MimeMap
RMEnsure MimeMap 0.10 RMLoad System:Modules.Network.MimeMap
RMEnsure MimeMap 0.10 Error This application requires MimeMap 0.10 or later

| Ensure that the Toolbox modules are available
Set Oregano2TB$Path System:Modules.Toolbox.

RMEnsure Toolbox         1.45 RMLoad Oregano2TB:Toolbox
RMEnsure Window          1.59 RMLoad Oregano2TB:Window
RMEnsure IconBar         1.18 RMLoad Oregano2TB:IconBar
RMEnsure Menu            0.35 RMLoad Oregano2TB:Menu
RMEnsure ProgInfo        0.15 RMLoad Oregano2TB:ProgInfo
RMEnsure SaveAs          0.16 RMLoad Oregano2TB:SaveAs

RMEnsure Toolbox         1.45 Error This application requires the Toolbox
RMEnsure Window          1.59 Error Failed to load Window Module
RMEnsure Iconbar         1.18 Error Failed to load IconBar Module
RMEnsure Menu            0.35 Error Failed to load Menu Module
RMEnsure ProgInfo        0.15 Error Failed to load ProgInfo Module
RMEnsure SaveAs          0.16 Error Failed to load SaveAs Module

Unset Oregano2TB$Path

| And Ensure that !ConfiX is booted
Filer_Run <Oregano2$Dir>.!ConfiX.!Boot

WimpSlot -Min 2512K -Max 2512K
<Oregano2$Dir>.!RunImage %*0
